Skip to content

Conversation

dabrahams
Copy link

Hi @tonyfreeman,

Sorry to abuse a PR this way but it's the only way I could find to get in touch. I was wondering about the suitability of this code for something I'm working on. It's a little language interpreter written in "trampolined continuation-passing style.” The key point is that the interpreter's user gets control back after each unit of work. CPS can be awkward, and it would be much cleaner to intersperse yields in a regular eager recursive interpreter implementation, run as a fiber, and just keep poking the fiber to move to the next step. But the examples I see here don't make it clear whether I can build such a structure. Channel looks kind of close; I wonder if you can offer any insight? Thanks!

Hi @tonyfreeman,

Sorry to abuse a PR this way but it's the only way I could find to get in touch.  I was wondering about the suitability of this code for something I'm working on.  It's a little language interpreter written in "trampolined continuation-passing style.”  The key point is that the interpreter's user gets control back after each unit of work.  CPS can be awkward, and it would be much cleaner to intersperse `yield`s in a regular eager recursive interpreter implementation, run as a fiber, and just keep poking the fiber to move to the next step.  But the examples I see here don't make it clear whether I can build such a structure.  `Channel` looks kind of close; I wonder if you can offer any insight?  Thanks!
@dabrahams
Copy link
Author

To further clarify, I am not interested in getting any actual parallelism. Nothing really needs to be asynchronous in my application. I just need the ability to, essentially, suspend and resume execution of a stack of function calls.

@tonyfreeman tonyfreeman deleted the branch swiftstack:tris.bak August 23, 2025 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants